import {NextRequest, NextResponse} from "next/server";
import {prisma} from "@/lib/db";

export async function POST(req: NextRequest) {
    const {id} = await req.json()
    const resume = await prisma.resume.findUnique({where: {id}})
    if (!resume) return NextResponse.json({"msg": "error"}, {status: 500})

    await prisma.resume.delete({
        where: {id}
    })

    return NextResponse.json({"msg": "ok"})
}